version: '3.7'

services:

  postgres:
    image: postgres:12
    restart: always
    env_file:
      - ./.env
    volumes:
      - ./pgdata:/var/lib/postgresql/data
      - ./postgresql.conf:/etc/postgresql/12/main/postgresql.conf
      - ./scripts/sql-scripts:/docker-entrypoint-initdb.d
    ports:
      - '5433:5432'
    environment:
      POSTGRES_DB: scraper_centraldispatch

  redis:
    image: redis
    restart: always
    ports:
     - '6378:6379'
    volumes:
      - ./redisdata:/var/lib/redis

  app:
    build: ./
    env_file:
      - ./.env
    restart: always
    entrypoint: ./scripts/entrypoint.sh
    depends_on:
      - postgres
      - redis
    environment:
      REDIS_HOST: redis
      REDIS_PORT: 6379
    
